<template>
<div class="layerRtb layerRtb-threecolumn">
    <three-title :title="{name:'做过项目'}"></three-title>
    <div class="layerRtb-scroll thinScroll" v-scrollHeight = "84">
        <!-- <div class="analyItem" v-if="flg==1">
            <p class="analyItemTit tx-center">做过项目</p>
            <div class="analyItemCon">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">面积</span>
                        <span>{{this.stageInfo.make_acreage_start ? this.stageInfo.make_acreage_start : 0}}-{{this.stageInfo.make_acreage_end ? stageInfo.make_acreage_end : 0}} 平米</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">类型</span>
                        <span>{{this.stageInfo.make_type ? this.stageInfo.make_type : ''}}</span>
                    </p>

                    <div class="imgbox imgbox1 col-md-3" style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg=0">
                    </div>

            </div>
        </div>
        <div class="analyItem" v-if="flg==0">
            <p class="analyItemTit tx-center">做过项目</p>
            <div class="analyItemCon">
                <p class="col-md-6">
                    <span class="cLightGray pr8">面积</span>
                    <input type="text" class="evaluateStandard" name="set_stage_info_make_acreage_start" style="width: 35px;" v-model="makeAcreageStart">--
                    <input type="text" class="evaluateStandard" name="set_stage_info_make_acreage_end" style="width: 35px;" v-model="makeAcreageEnd"> 平米
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">类型</span>
                    <input type="text" class="width120 evaluateStandard" name="set_stage_info_make_type" v-model="makeType">
                </p>
                </div>
            <div class="imgbox imgbox2 " style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateStageInfoByleId()">
                <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg=1">
            </div>
        </div> -->
        <div class="analyItem">
            <p class="analyItemTit tx-center" :class="this.stageInfo.personnel_management === undefined || this.stageInfo.personnel_management === null || this.stageInfo.personnel_management === '' || Number(this.stageInfo.personnel_management) === 1 ||
            this.stageInfo.site_management === undefined || this.stageInfo.site_management === null || this.stageInfo.site_management === '' || Number(this.stageInfo.site_management) === 1 ||
            this.stageInfo.material_management === undefined || this.stageInfo.material_management === null || this.stageInfo.material_management === '' || Number(this.stageInfo.material_management) === 1 ||
            this.stageInfo.money_management === undefined || this.stageInfo.money_management === null || this.stageInfo.money_management === '' || Number(this.stageInfo.money_management) === 1 ? '' : 'analyLightGreen'">管理</p>
            <div class="analyItemCon" v-if="flg==1">
                    <p class="col-md-6">
                        <span class="cLightGray pr8">人员管理</span>
                        <span>{{this.stageInfo.personnel_management === 0 ? '是' : '否'}}</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">现场管理</span>
                        <span>{{this.stageInfo.site_management === 0 ? '是' : '否'}}</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">材料管理</span>
                        <span>{{this.stageInfo.material_management === 0 ? '是' : '否'}}</span>
                    </p>
                    <p class="col-md-6">
                        <span class="cLightGray pr8">资金管理</span>
                        <span>{{this.stageInfo.money_management === 0 ? '是' : '否'}}</span>
                    </p>
                    <div class="imgbox imgbox1 col-md-3" style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                        <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/edit_img.png" title="编辑" width="20" class="fr pointer mr5" @click="flg=0">
                    </div>

            </div>
            <div class="analyItemCon" v-if="flg==0">
                <p class="col-md-6">
                    <span class="cLightGray pr8">人员管理</span>
                    <select name="set_stage_info_investigate_approval" class="width80" v-model="stageInfo.personnel_management">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">现场管理</span>
                    <select name="set_stage_info_investigate_approval" class="width80" v-model="stageInfo.site_management">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">材料管理</span>
                    <select name="set_stage_info_investigate_approval" class="width80" v-model="stageInfo.material_management">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </p>
                <p class="col-md-6">
                    <span class="cLightGray pr8">资金管理</span>
                    <select name="set_stage_info_investigate_approval" class="width80" v-model="stageInfo.money_management">
                        <option value="0">是</option>
                        <option value="1">否</option>
                    </select>
                </p>
            <!-- </div> -->
                <div class="imgbox imgbox2 " style="margin-top: 15px; position: absolute; right: 10px;top: 10px;">
                    <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/save_img.png" title="保存" width="20" class="fl pointer mr5" name="update_stage_info_intention" @click="updateStageInfoByleId()">
                    <img src="https://gnr.rxjy.com/hrms/static/modules/cur/images/goback_img.png" title="返回" width="20" class="fl pointer mr5" @click="flg=1">
                </div>
            </div>
        </div>
    </div>
            <div class="analyItem">
            <p class="analyItemTit tx-center">综合</p>
            <div class="analyItemCon">
                <p class="fl">
                    <span v-if="this.stageInfo.personnel_management === undefined || this.stageInfo.personnel_management === null || this.stageInfo.personnel_management === '' || this.stageInfo.personnel_management === 1 ||
            this.stageInfo.site_management === undefined || this.stageInfo.site_management === null || this.stageInfo.site_management === '' || this.stageInfo.site_management === 1 ||
            this.stageInfo.material_management === undefined || this.stageInfo.material_management === null || this.stageInfo.material_management === '' || this.stageInfo.material_management === 1 ||
            this.stageInfo.money_management === undefined || this.stageInfo.money_management === null || this.stageInfo.money_management === '' || this.stageInfo.money_management === 1" class="circlemark circlemark-lightRed">待</span>
                    <span v-else class="circlemark circlemark-lightGreen">全</span>
                </p>
            </div>
        </div>
</div>
</template>
<script>
import { mapGetters, mapMutations } from 'vuex'
import { updateStageInfoByleId } from '../../Resources/Api/index'
export default {
    data () {
        return {
            flg: 1,
            stageInfo: {} // 用户的信息
            // makeAcreageStart: 0, // 做过面积开始值
            // makeAcreageEnd: 0, // 做过面积结束值
            // makeType: '' // 做过面积类型
        }
    },
    created () {
        this.stageInfo = this.$route.query.stageInfo
        // this.makeAcreageStart = this.stageInfo.make_acreage_start
        // this.makeAcreageEnd = this.stageInfo.make_acreage_end
        // this.makeType = this.stageInfo.make_type
    },
    methods: {
        ...mapMutations({
            setUpdatePlate: `SET_UPDATE_PLATE`
        }),
        // 考察阶段修改用户的做过面积的开始值和结束值
        updateStageInfoByleId () {
            // if (this.makeAcreageStart === null || this.makeAcreageStart === '') {
            //     layer.msg('请输入面积开始值')
            //     return
            // }
            // if (this.makeAcreageEnd === null || this.makeAcreageEnd === '') {
            //     layer.msg('请输入面积结束值')
            //     return
            // }
            // if (this.makeType === null || this.makeType === '') {
            //     layer.msg('请输入类型')
            //     return
            // }
            updateStageInfoByleId({
                uid: this.leftInfo.uid, // 用户id
                // makeAcreageStart: this.makeAcreageStart, // 开始值
                // makeAcreageEnd: this.makeAcreageEnd, // 结束值
                // makeType: this.makeType // 类型
                personnelManagement: this.stageInfo.personnel_management,
                siteManagement: this.stageInfo.site_management,
                materialManagement: this.stageInfo.material_management,
                moneyManagement: this.stageInfo.money_management
            }).then(result => {
                if (Number(result.data.StatusCode) === 0) {
                    layer.msg('修改成功')
                    this.$router.push(this.$route.matched[1].path)
                }
            }).catch(err => {
                console.log('考察阶段修改用户的管理信息失败，异常信息：' + err)
            })
        }
    },
    computed: {
        ...mapGetters(['leftInfo'])
    }
}
</script>
<style  scoped>
    .imgbox {
    position: absolute;
    right: 10px;
    top: 10px;
}
</style>
